﻿// CFidParDlg.cpp: 实现文件
//

#include "stdafx.h"
#include "DC-QC.h"
#include "CFidParDlg.h"
#include "afxdialogex.h"


// CFidParDlg 对话框

IMPLEMENT_DYNAMIC(CFidParDlg, CDialogEx)

CFidParDlg::CFidParDlg(CWnd* pParent /*=nullptr*/)
	: CDialogEx(IDD_FIDSETDLG, pParent)
{
	m_nCurID = -1;
}

CFidParDlg::~CFidParDlg()
{
}

void CFidParDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialogEx::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_CHASENSITIVITY, m_dCHASensitivity);
	DDX_Text(pDX, IDC_CHBSENSITIVITY, m_dCHBSensitivity);
	DDX_Text(pDX, IDC_TGSENSITIVITY, m_dTGSensitivity);
	DDX_Text(pDX, IDC_CHAFIRLVL, m_dCHAFireLVL);
	DDX_Text(pDX, IDC_CHBFIRLVL, m_dCHBFireLVL);
	DDX_Text(pDX, IDC_TGFIRLVL, m_dTGFireLVL);
}


BEGIN_MESSAGE_MAP(CFidParDlg, CDialogEx)
	ON_BN_CLICKED(IDOK, &CFidParDlg::OnBnClickedOk)
	ON_BN_CLICKED(IDCANCEL, &CFidParDlg::OnBnClickedCancel)
END_MESSAGE_MAP()


// CFidParDlg 消息处理程序


BOOL CFidParDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// TODO:  在此添加额外的初始化
	m_dCHASensitivity = gl.gcMachine.dSignalSensitivity[0];
	m_dCHBSensitivity = gl.gcMachine.dSignalSensitivity[1];
	m_dTGSensitivity = gl.gcMachine.dSignalSensitivity[2];
	m_dCHAFireLVL = gl.gcMachine.dAFlameout;
	m_dCHBFireLVL = gl.gcMachine.dBFlameout;
	m_dTGFireLVL = gl.gcMachine.dCFlameout;
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
				  // 异常: OCX 属性页应返回 FALSE
}


void CFidParDlg::OnBnClickedOk()
{
	// TODO: 在此添加控件通知处理程序代码
	UpdateData(TRUE);
	gl.gcMachine.dSignalSensitivity[0]=m_dCHASensitivity;
	if (gl.m_nWorkMode == 0 || gl.m_nWorkMode == 3)
		gl.gcMachine.dSignalSensitivity[1] = m_dCHASensitivity;
	else
		gl.gcMachine.dSignalSensitivity[1]= m_dCHBSensitivity;
	gl.gcMachine.dSignalSensitivity[2]=m_dTGSensitivity;
	gl.gcMachine.dAFlameout=m_dCHAFireLVL;
	gl.gcMachine.dBFlameout=m_dCHBFireLVL;
	gl.gcMachine.dCFlameout=m_dTGFireLVL;
	CDialogEx::OnOK();
}



void CFidParDlg::OnBnClickedCancel()
{
	// TODO: 在此添加控件通知处理程序代码
	CDialogEx::OnCancel();
}
